.PHONY: all
.PHONY: def
.PHONY: win
.PHONY: lin
.PHONY: rep
.PHONY: out
.PHONY: out2
.PHONY: out9

REPORT = /mnt/sdcard/_common/report.pdf
OUTPUT = /mnt/sdcard/_common/output.pdf
OUTPUT2 = /mnt/sdcard/_common/output2.pdf
OUTPUT9 = /mnt/sdcard/_common/output9.pdf

all: def rep out;

def: prog;

lin: prog;

win: prog.exe;

prog.exe: prog.cpp
	mingw32-g++ -O3 -lm prog.cpp -o prog.exe

prog: prog.cpp
	g++ -O3 -lm -std=c++0x prog.cpp -o prog

report.pdf: report.tex
	pdflatex report.tex

$(REPORT): report.pdf
	sudo -- cp report.pdf $(REPORT)

rep: $(REPORT);

output.pdf: output.tex
	pdflatex output.tex

output2.tex: def
	./prog 2 0.000000001 0 0 1 0 0 1 > output2.tex

output9.tex: def
	./prog 9 0.000000001 0 0 1 0 0 1 > output9.tex

output2.pdf: output2.tex
	pdflatex output2.tex

output9.pdf: output9.tex
	pdflatex output9.tex

$(OUTPUT): output.pdf
	sudo -- cp output.pdf $(OUTPUT)

$(OUTPUT2): output2.pdf
	sudo -- cp output2.pdf $(OUTPUT2)

$(OUTPUT9): output9.pdf
	sudo -- cp output9.pdf $(OUTPUT9)
     
out: $(OUTPUT);

out2: $(OUTPUT2);

out9: $(OUTPUT9);
